package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.Participant;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @author xq
 */
public interface ParticipantDao {

    /**
     * 批量插入参与人信息
     *
     * @param participants
     * @throws SQLException
     */
    void insertBatchParticipants(List<Participant> participants) throws SQLException;

    /**
     * 作废审批参与状态
     *
     * @param requestId
     * @param companyId
     * @throws SQLException
     */
    void updateParticipantState(Integer requestId, Integer companyId) throws SQLException;

    /**
     * 查询用户参与的审批
     *
     * @param companyId
     * @param companyInfoId
     * @param finishedSequence
     * @param financialStatusSequence
     * @param orderBy
     * @return
     * @throws SQLException
     */
    List<Integer> selectParticipateRequestIdsByCompanyInfoId(Integer companyId, Integer companyInfoId, String finishedSequence, String financialStatusSequence, String orderBy) throws SQLException;

    /**
     * 批量查询参与人
     *
     * @param requestIds
     * @return
     * @throws SQLException
     */
    Map<Integer, List<Participant>> selectBatchParticipant(String requestIds) throws SQLException;

    /**
     * 删除用户红点
     *
     * @param requestId
     * @param companyInfoId
     * @throws SQLException
     */
    void deleteRedPoint(Integer requestId, Integer companyInfoId) throws SQLException;

    void deleteRedPoint(Integer requestId) throws SQLException;

    /**
     * 获取用户所有参与红点
     *
     * @param companyId
     * @param companyInfoId
     * @return
     * @throws SQLException
     */
    List<Integer> selectUnReadRequestIds(Integer companyId, Integer companyInfoId) throws SQLException;

    /**
     * 查询审批参与人红点信息
     *
     * @param requestId
     * @param companyInfoId
     * @return
     * @throws SQLException
     */
    List<Participant> selectParticipateRedPointInfo(Integer requestId, Integer companyInfoId) throws SQLException;

    List<Participant> selectParticipateRedPointInfo(Integer requestId) throws SQLException;

    List<Integer> selectUserNearlyParticipant(Integer companyInfoId) throws SQLException;

    List<Participant> selectParticipantsByRequestId(Integer requestId) throws SQLException;
}
